package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 虎哥
 */
public interface BrandMapper extends BaseMapper<Brand> {
    @Select("SELECT b.id, b.name, b.image, b.letter \n" +
            "FROM tb_category_brand cb\n" +
            "INNER JOIN tb_brand b ON cb.brand_id = b.id\n" +
            " WHERE cb.category_id = #{categoryId}")
    List<Brand> queryByCategoryId(@Param("categoryId") Long categoryId);
}